import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class chatclient {
    public static void main(String[] args) {
        try {
            Socket client = new Socket("localhost",9900);
            OutputStream os = client.getOutputStream();
            ObjectOutputStream oos=new ObjectOutputStream(os);
            System.out.println("请输入姓名");
            Scanner scanner = new Scanner(System.in);
            String name = scanner.next();
            oos.writeObject(name);

        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
